package com.crop.back.vo;

import com.crop.back.entity.*;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class QrcodeVo {
    private String traceId;

    private Long batchId;

    private ProductInfo product;

    private Supplier supplier;

    private List<GrowingRecord> growingRecords;

    private ProcessingInfo processing;

    private List<QualityInspectionInfo> qualityInspection;
    
    @Data
    public static class ProductInfo extends Product {
        private String category;
    }
    
    @Data
    public static class GrowingRecord extends ProductRecord {
        @SerializedName("recordTime")
        @Override
        public LocalDateTime getCreateTime() {
            return super.getCreateTime();
        }
    }
    
    @Data
    public static class ProcessingInfo extends ProcessingBatch {
        @SerializedName("processor")
        private Processor processor;
    }
    
    
    @Data
    public static class QualityInspectionInfo extends QualityInspection {
        @SerializedName("inspectionTime")
        @Override
        public LocalDateTime getCreateTime() {
            return super.getCreateTime();
        }
    }
} 